//
//  LOLForthSkillTableViewCell.m
//  LOLXXbox
//
//  Created by dllo on 16/2/27.
//  Copyright © 2016年 Grasstrio. All rights reserved.
//

#import "LOLForthSkillTableViewCell.h"

@implementation LOLForthSkillTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.tipsLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        //        self.descripLabel.font = [UIFont systemFontOfSize:15];
        self.tipsLabel.numberOfLines = 0;
        [self addSubview:self.tipsLabel];
        
    }
    return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    
    self.tipsLabel.frame = CGRectMake(10, 0, self.frame.size.width - 20, self.frame.size.height);
    
}

- (CGFloat )getHeight {
    //    定义一个字典存储label上的字体等信息
    NSDictionary *dic = @{NSFontAttributeName:[UIFont systemFontOfSize:18]};
    //    通过字典计算高度和宽度
    CGRect rect = [self.tipsLabel.text boundingRectWithSize:CGSizeMake(self.frame.size.width, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    self.tipsLabel.frame = CGRectMake(_tipsLabel.frame.origin.x, _tipsLabel.frame.origin.y, _tipsLabel.frame.size.width, rect.size.height);
    return rect.size.height;
    
}



- (void)setSkillModel:(LOLSkillsModel *)skillModel{
    _skillModel = skillModel;
    self.tipsLabel.text = self.skillModel.tips;
}


@end
